<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 
<%@ include file="../../header.jsp"%>
<link rel="stylesheet" type="text/css" href="${ctx }/webuploader/webuploader.css">
<link rel="stylesheet" type="text/css" href="${ctx }/webuploader/style.css">
<script type="text/javascript" src="${ctx }/webuploader/webuploader.js"></script>
<script type="text/javascript" src="${ctx }/views/home/index.js"></script>
<script type="text/javascript" src="${ctx }/views/include/choosetype.js"></script>
<script type="text/javascript" src="//apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<meta charset="UTF-8" />
<style>
	.banner_img img{
		width:100%;
		height:60px;
	}
	
	.alert-dismissable{
		display:none;
	}
	
	.list-group-item:hover{
		background: #f5f5f5;
		cursor: pointer;
	}
</style>
<script>
$(".mkbanner >li:eq(6)").addClass("active");
</script>
<div class="container">
	<div class="row">
	<div class="col-lg-12">
	 <ol class="breadcrumb">
	  <li><a href="#">首页</a></li>
	  <li><a href="#" class="active">banner</a></li>
	</ol>
	</div>
	</div>
	<div class="row">
		<form id="defaultForm" class="form-horizontal" role="form" action="${ctx }/home/addbanner" method="post">
			   <div class="form-group">
				    <label for="exampleInputName2">banner类型</label>
				    <select class="form-control bannerType" name="bannerType">
				      <option value="">--banner类型--</option>
					  <option value="0">专题</option>
					  <option value="1">商品</option>
					  <option value="2">帖子</option>
					  <option value="3">活动</option>
					</select>
			  </div>
			  <div class="form-group">
			    <label for="exampleInputEmail2">banner值</label>
			    <input class="form-control" name="bannerValue" id="bannerValue" placeholder="此值自动生成" readonly="readonly">
			    <input name="key" type="hidden" id="key">
			  </div>
			  <div class="form-group">
						   <div id="fileList" class="uploader-list"></div>
						   <div id="filePicker">选择图片</div>
			  </div>
			  <div class="form-group">
				<button type="submit" class="btn btn-info">添 加</button>
			  </div>
		</form>
		</div>
		<div class="alert alert-success alert-dismissable">
			   <button type="button" class="close" data-dismiss="alert" aria-hidden="true">
			      &times;
			   </button>
			   很好地完成了排序。
			</div>
		<div class="panel panel-info">
		   <div class="panel-heading">
		      <h3 class="panel-title">banner列表</h3>
		   </div>
		   <div class="panel-body">
		      	<ul class="list-group">
		      	<c:forEach items="${banners }" var="bean">
		      	 <li class="list-group-item" id="${bean.id }">
		      	 	<div class="row">
		      	 		<div class="col-lg-2">${bean.bannerTypestr }</div>
		      	 		<div class="col-lg-8 banner_img"><img alt="" src="${bean.img }"></div>
		      	 		<div class="col-lg-2">
		      	 		<button type="button" class="btn btn-info banner_but" data-r="${bean.id }">删除</button>
		      	 		</div>
		      	 	</div>
		      	 </li>
		      	</c:forEach>
				</ul>
		   </div>
		</div>
		
</div>
<%@ include file="../include/choosetype.jsp" %>
<!-- <!-- 模态框（Modal）
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
   <div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">×
            </button>
            <h4 class="modal-title" id="myModalLabel">
              
            </h4>
         </div>
         <div class="modal-body">
            		数据加载中..
         </div>
         <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal">关闭
            </button>
         </div>
      </div>/.modal-content
   </div>/.modal-dialog
</div>/.modal -->